/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.impl;

import es.upm.dit.gsi.eclipse.jadex.diagram.eclipseJadex.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class EclipseJadexFactoryImpl extends EFactoryImpl implements EclipseJadexFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static EclipseJadexFactory init() {
		try {
			EclipseJadexFactory theEclipseJadexFactory = (EclipseJadexFactory)EPackage.Registry.INSTANCE.getEFactory("http://code.google.com/p/plugin-eclipse-jadex/"); 
			if (theEclipseJadexFactory != null) {
				return theEclipseJadexFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new EclipseJadexFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EclipseJadexFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case EclipseJadexPackage.PROJECT: return createProject();
			case EclipseJadexPackage.AGENT: return createAgent();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Project createProject() {
		ProjectImpl project = new ProjectImpl();
		return project;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Agent createAgent() {
		AgentImpl agent = new AgentImpl();
		return agent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EclipseJadexPackage getEclipseJadexPackage() {
		return (EclipseJadexPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static EclipseJadexPackage getPackage() {
		return EclipseJadexPackage.eINSTANCE;
	}

} //EclipseJadexFactoryImpl
